//
//  ADVideoView.m
//  XRmenu
//
//  Created by gaomz on 11-11-23.
//  Copyright 2011年 foxhis. All rights reserved.
//

#import "ADVideoView.h"


@implementation ADVideoView



-(id)initWithViewName:(NSString *)vname videoName:(NSString *)videoName videoFileName:(NSString *)videoFileName
{
	NSDictionary* aDic = [self findNode:APPSESSION.allconfig withKey:vname];
	if ((self=[super initWithConfig:aDic])) {
		[self add1fingerLeftSwipe];
		[self add1fingerRightSwipe];
		[self add1fingerTopSwipe];
		[self add1fingerDownSwipe];
		
		
		UILabel *lbTitle = (UILabel *)[self viewWithTag:kTagOfStartLabel];
		[lbTitle setTextAlignment:UITextAlignmentCenter];
		[lbTitle setText:videoName];
		
		VideoPlayer *player = (VideoPlayer *)[self viewWithTag:kTagOfStartVideo];
		[player setPlayerUrl:videoFileName];
		[player playVideo];
		
		
	}
	return self;
}


#pragma mark 按钮点击事件
-(void) buttonClicked:(id)sender
{
	[self removeFromSuperview];
}

#pragma mark 手势操作
- (void)handleSwipeLeft:(UISwipeGestureRecognizer *)recognizer {
	
}

- (void)handleSwipeRight:(UISwipeGestureRecognizer *)recognizer {
	
}

-(void)handleSwipeTop:(UISwipeGestureRecognizer *)recognizer
{
	
}
-(void)handleSwipeDown:(UISwipeGestureRecognizer *)recognizer
{
	
}



-(void)dealloc
{
	[super dealloc];
}

@end
